<!DOCTYPE html>
<html lang="zh_CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>find和filter练习</title>
  </head>
  <body>
    <script>
      let array = ['anyun', '安云', '藏阁', 'cangge']
      console.log(
        array.filter((item) => item.includes('a')),
        'filter:根据过滤条件返回过滤内容（数组），true是返回的内容，false则是过滤的内容'
      )
      console.log(
        array.find((item) => item.includes('a')),
        'find:禁止贪婪，当匹配到查找内容后则返回内容'
      )
    </script>
  </body>
</html>
